package com.roc.jpamysql.service.impl;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.roc.jpamysql.dao.UserPlusMapper;
import com.roc.jpamysql.model.T1;
import com.roc.jpamysql.service.UserPlusService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@DS("roc")
public class UserPlusServiceImpl extends ServiceImpl<UserPlusMapper, T1> implements UserPlusService {

    @Autowired
    private UserPlusMapper userPlusMapper;

    public Integer getUserByWapper() {
        QueryWrapper<T1> t1QueryWrapper = new QueryWrapper<>();
        t1QueryWrapper.eq("a",1);
        List<T1> t1s = userPlusMapper.selectList(t1QueryWrapper);
        return t1s.size();
    }
}
